package team.sun.sss.dao.staff;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import team.sun.sss.pojo.staff.StaffCourse;

import java.util.List;

@Mapper
@Repository
public interface StaffCourseDao {

    @Select("select * from staff_course")
    List<StaffCourse> getStaffCourse();

    @Select("select * from staff_course where sta_num=#{staNum}")
    List<StaffCourse> getStaffCourseById(String staNum);

    @Delete("delete from staff_course where course_id=#{courseId}")
    int deleteStaffCourse(int courseId);

    @Insert("insert into staff_course(course_name,course_begin,course_end,sta_num) values(#{courseName},#{courseBegin},#{courseEnd},#{staNum})")
    int addStaffCourse(StaffCourse staffCourse);

    @Update("update staff_course set course_name=#{courseName},course_begin=#{courseBegin},course_end=#{courseEnd},sta_num=#{staNum} where course_id=#{courseId}")
    int updateStaffCourse(StaffCourse staffCourse);
}
